import request from '../http/index.js';
import config from '../config/config.js';
const servekey = config.servekey;
export default {
	// 单文件上传 
	uploadImage(data) {
		return request({
			url: '/api/file/file/upload',
			method: 'POST',
			data
		})
	},
	// 关键字搜索
	/**
	 * @param {Object} data
	 */
	keywordSearch(data) {
		return request({
			// url: `https://restapi.amap.com/v3/place/text?key=${servekey}&city=${data.city?data.city:''}&citylimit=true&extensions=all&page=${data.page?data.page:1}&keywords=${data.keywords}&offset=4`,
			url: `/v3/place/text?key=${servekey}&city=${data.city?data.city:''}&citylimit=true&extensions=all&page=${data.page?data.page:1}&keywords=${data.keywords}&offset=4`,
			method: 'GET',
		})
	},
	// 周边搜索
	nearSearch(data) {
		return request({
			// url: `https://restapi.amap.com/v3/place/text?key=${servekey}&location=${data.location}&extensions=all&page=${data.page?data.page:1}&keywords=${data.keywords}`,
			url: `/v3/place/text?key=${servekey}&location=${data.location}&extensions=all&page=${data.page?data.page:1}&keywords=${data.keywords}`,
			method: 'GET',
		})
	},
	// 兴趣点详情
	keydetail(data) {
		return request({
			// url: `https://restapi.amap.com/v3/place/detail?id=${data.id}&key=${servekey}`,
			url: `/v3/place/detail?id=${data.id}&key=${servekey}`,
			method: 'GET',
		})
	},
}